<?php

namespace app\common\model;

use think\Model;

class AppletToken extends Model
{

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 定义字段类型
    protected $type = [
    ];
    protected $append = [
    ];

    /**
     * 获取token
     */
    public static function getToken($applet_id=0,$token_type=10)
    {
        return self::where([
            'token_type' => $token_type,
            'applet_id' => $applet_id
        ])->find();
    }
    
}
